#include #include #include #include using namespace std; #include void ap(int [],int, string); void bubble(int [],int); void main(){ int a[10]; srand(time(0)); for(int i=0; i<10; i++) a[i] = rand()%1000+1; ap(a,10,"after random generation"); //bubble(a,10); sort(a,a+10); ap(a,10,"after bubble sort"); } void bubble(int a[],int s){ int count=0; // 2 for loops O(n^2) for(int i=0; ia[j+1]){ int temp = a[j]; a[j] = a[j+1]; a[j+1] = temp; } } } cout << "bubble sort effort "<< count << endl; } void ap(int a[], int s, string msg){ cout<< msg << endl; for(int i=0; i